#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
char* my_strncpy(char* dest, const char* scr,int n)
{
	char* tem = dest;
	while (n-- && *dest)
	{
		if (*scr)
		{
			*dest++ = *scr++;
		}
		else
		{
			*dest++ = '\0';
		}
	}
	return tem;
}
int main()
{
	char ch[] = "my love";
	char ch1[] = "oooo";
	printf("%s",my_strncpy(ch, ch1, 2));
	return 0;
}